/******************************************************************************\
    Action.h contains post requests handlers.
    It's used with acm server. See main.cpp for details.
    Copyright (C) 2008  Victor Vinogradov (fly3333@gmail.com)

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
\******************************************************************************/

#pragma once

#include <string>
#include <map>
#include ".\ClientDataBase.h"
#include <Common\Format.h>

int LoginAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, std::string &cookie );
int LogoutAction( unsigned long cookie_id, const cFormat parameter );
int ShutdownAction( const nsClientDataBase::sClientData &client_data, const cFormat parameter );
int AddContestantAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &contestant_id );
int EditContestantAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &contestant_id );
int DeleteContestantAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &contestant_id );
int AddPluginAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &plugin_id );
int UpdatePluginAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &plugin_id );
int EnablePluginAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &plugin_id );
int ConfigurePluginAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &plugin_id );
int DeletePluginAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &plugin_id );
int ProxyAction( const nsClientDataBase::sClientData &client_data, const cFormat argument );
int AddContestAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &contest_id );
int EditContestAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &contest_id );
int DeleteContestAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &contest_id );
int AddContestProblemAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &contest_id );
int EditContestProblemAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &contest_id );
int DeleteContestProblemAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &contest_id );
//int SelectContestantsAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &contest_id, std::string &contestant_id );
//int ContestContestantsAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &contest_id, bool &is_edit_action, std::string &contest_contestant_id );
int AddContestContestantAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &contest_id );
int EditContestContestantAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &contest_id );
int DeleteContestContestantAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &contest_id );
int RecalculateRealTimesOfSubmits( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &contest_id );
int RecalculateRelativeTimesOfSubmits( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &contest_id );
int AddContestContestantProblemAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &contest_contestant_id );
int EditContestContestantProblemAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &contest_contestant_id );
int DeleteContestContestantProblemAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &contest_contestant_id );
int StartContestAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &contest_id );
int SubmitAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &contest_id, unsigned long &contest_contestant_id );
int RejudgeAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &contest_contestant_id );
int RejudgeProblemAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &contest_id );
int AddSubmitsAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &contest_id );
int UploadContestAction( const nsClientDataBase::sClientData &client_data, const cFormat argument, unsigned long &contest_id );
